package cn.csust.net2.manager.shared.vo;

import java.io.Serializable;

import java.util.Map;
import java.util.Map.Entry;
import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.data.BeanModelFactory;
import com.extjs.gxt.ui.client.data.BeanModelLookup;
import com.extjs.gxt.ui.client.data.BeanModelTag;

public class Root implements Serializable, BeanModelTag {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public static BeanModel initialize(Map<String, Object> configs) {
		BeanModel bm = null;
		if (bm == null) {
			BeanModelFactory beanModelFactory = BeanModelLookup.get().getFactory(Root.class);
			Root r = new Root();
			r.setId(1);
			bm = beanModelFactory.createModel(new Root());
			if (bm.getBean() instanceof Root) {

				System.out.println("测试工厂生成的ROOT的BEANmODUEL是否成功");

			}
		}

		for (Entry<String, Object> en : configs.entrySet()) {
			String key = en.getKey();
			Object value = en.getValue();
			bm.set(key, value);
			System.out.println(key + "sssssssssssssssssssssss" + value);
		}
		return bm;
	}

}
